---
title: Notification
---

A notification is a channel that is used to send alerts when your monitor status changes. By default no notifications are created in your workspace.


## Notification Channels:

### Slack

Require a [Slack incoming webhook](https://api.slack.com/incoming-webhooks)

### Email

Require an email address

### Discord

Require a [discord webhook](https://support.discord.com/hc/en-us/articles/228383668
) e.g. `https://discordapp.com/api/webhooks/123456789012345678/abcdefghijklmnopqrstuvwxyz1234567890`

### SMS

Require a phone number

### Webhook

- URL (require)
- Headers (optional)

#### Notification Payloads

##### Payload for Monitor Recovery

```json
{
  "monitor": {
    "id": 1,
    "name": "test",
    "url": "http://openstat.us"
  },
  "cronTimestamp": 1744023705307,
  "status": "recovered",
  "statusCode": 200,
  "latency": 1337
}
```


Fields Explanation:
-	monitor: Contains details about the monitor.
    -	id: Unique identifier for the monitor.
    -	name: Name of the monitor.
    -	url: The URL being monitored.
-	cronTimestamp: The timestamp when the check was executed, in milliseconds since epoch.
-	status: Indicates the current status of the monitor (in this case, "recovered").
-	statusCode: The HTTP status code returned by the monitored service.
-	latency: The time taken to complete the check, in milliseconds.


##### Payload for Monitor Failure

```json
{
  "monitor": {
    "id": 1,
    "name": "test",
    "url": "http://openstat.us"
  },
  "cronTimestamp": 1744023705307,
  "status": "error",
  "errorMessage": "Connection refused"
}
```

Fields Explanation:

-	monitor: Contains details about the monitor.
    -	id: Unique identifier for the monitor.
  	-	name: Name of the monitor.
  	-	url: The URL being monitored.
-	cronTimestamp: The timestamp when the check was executed, in milliseconds since epoch.
-	status: Indicates the current status of the monitor (in this case, "error").
-	errorMessage: A description of the error encountered during the check.


#### Zod Schema


```ts
import { z } from "zod";

export const PayloadSchema = z.object({
  monitor: z.object({
    id: z.number(),
    name: z.string(),
    url: z.string(),
  }),
  cronTimestamp: z.number(),
  status: z.enum(["degraded", "error", "recovered"]),
  statusCode: z.number().optional(),
  latency: z.number().optional(),
  errorMessage: z.string().optional(),
});
````

### OpsGenie

- API key from OpsGenie (required)

### PagerDuty

Follow the step in PagerDuty workflow

### Ntfy

- Ntfy topic (required)
- Custom server url (optional)
- bearer token (optional)
